﻿using System;
using System.Collections;
using System.Collections.Generic;
using CARMSBusiness;
using CARMSData.EntityClasses;

namespace CARMS.Controls
{
    public partial class Navigator : UserControlBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            BindNavigator();
        }
        private void BindNavigator()
        {
            if (!string.IsNullOrEmpty(CurrentFunction))
            {
                rptPath.DataSource = GetPath();
                rptPath.DataBind();
            }
        }
        private static IEnumerable GetPath()
        {
            var list = new List<ActionEntity>();
            list.Add(AdminBusiness.GetActionParentByID(CurrentFunction));
            list.Add(AdminBusiness.GetActionByID(CurrentFunction));
            return list;
        }
    }
}